

<!DOCTYPE html>
<html class="writer-html5" lang="zh" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>发送电子邮件 &mdash; Scrapy 2.3.0 文档</title>
  

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tooltipster.custom.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tooltipster.bundle.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tooltipster-sideTip-shadow.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tooltipster-sideTip-punk.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tooltipster-sideTip-noir.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tooltipster-sideTip-light.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tooltipster-sideTip-borderless.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/micromodal.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/sphinx_rtd_theme.css" type="text/css" />

  
  
  
  

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
        <script src="../_static/js/hoverxref.js"></script>
        <script src="../_static/js/tooltipster.bundle.min.js"></script>
        <script src="../_static/js/micromodal.min.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" />
    <link rel="next" title="远程登录控制台" href="telnetconsole.html" />
    <link rel="prev" title="统计数据集合" href="stats.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home" alt="Documentation Home"> Scrapy
          

          
          </a>

          
            
            
              <div class="version">
                2.3
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">第一步</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../intro/overview.html">Scrapy一目了然</a></li>
<li class="toctree-l1"><a class="reference internal" href="../intro/install.html">安装指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../intro/tutorial.html">Scrapy 教程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../intro/examples.html">实例</a></li>
</ul>
<p class="caption"><span class="caption-text">基本概念</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="commands.html">命令行工具</a></li>
<li class="toctree-l1"><a class="reference internal" href="spiders.html">蜘蛛</a></li>
<li class="toctree-l1"><a class="reference internal" href="selectors.html">选择器</a></li>
<li class="toctree-l1"><a class="reference internal" href="items.html">项目</a></li>
<li class="toctree-l1"><a class="reference internal" href="loaders.html">项目加载器</a></li>
<li class="toctree-l1"><a class="reference internal" href="shell.html">Scrapy shell</a></li>
<li class="toctree-l1"><a class="reference internal" href="item-pipeline.html">项目管道</a></li>
<li class="toctree-l1"><a class="reference internal" href="feed-exports.html">Feed 导出</a></li>
<li class="toctree-l1"><a class="reference internal" href="request-response.html">请求和响应</a></li>
<li class="toctree-l1"><a class="reference internal" href="link-extractors.html">链接提取器</a></li>
<li class="toctree-l1"><a class="reference internal" href="settings.html">设置</a></li>
<li class="toctree-l1"><a class="reference internal" href="exceptions.html">例外情况</a></li>
</ul>
<p class="caption"><span class="caption-text">内置服务</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="logging.html">登录</a></li>
<li class="toctree-l1"><a class="reference internal" href="stats.html">统计数据集合</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">发送电子邮件</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#quick-example">快速实例</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mailsender-class-reference">MailSender 类引用</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mail-settings">邮件设置</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#mail-from">MAIL_FROM</a></li>
<li class="toctree-l3"><a class="reference internal" href="#mail-host">MAIL_HOST</a></li>
<li class="toctree-l3"><a class="reference internal" href="#mail-port">MAIL_PORT</a></li>
<li class="toctree-l3"><a class="reference internal" href="#mail-user">MAIL_USER</a></li>
<li class="toctree-l3"><a class="reference internal" href="#mail-pass">MAIL_PASS</a></li>
<li class="toctree-l3"><a class="reference internal" href="#mail-tls">MAIL_TLS</a></li>
<li class="toctree-l3"><a class="reference internal" href="#mail-ssl">MAIL_SSL</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="telnetconsole.html">远程登录控制台</a></li>
<li class="toctree-l1"><a class="reference internal" href="webservice.html">Web服务</a></li>
</ul>
<p class="caption"><span class="caption-text">解决具体问题</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">常见问题</a></li>
<li class="toctree-l1"><a class="reference internal" href="debug.html">调试spiders</a></li>
<li class="toctree-l1"><a class="reference internal" href="contracts.html">蜘蛛合约</a></li>
<li class="toctree-l1"><a class="reference internal" href="practices.html">常用做法</a></li>
<li class="toctree-l1"><a class="reference internal" href="broad-crawls.html">宽爬行</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer-tools.html">使用浏览器的开发人员工具进行抓取</a></li>
<li class="toctree-l1"><a class="reference internal" href="dynamic-content.html">选择动态加载的内容</a></li>
<li class="toctree-l1"><a class="reference internal" href="leaks.html">调试内存泄漏</a></li>
<li class="toctree-l1"><a class="reference internal" href="media-pipeline.html">下载和处理文件和图像</a></li>
<li class="toctree-l1"><a class="reference internal" href="deploy.html">部署蜘蛛</a></li>
<li class="toctree-l1"><a class="reference internal" href="autothrottle.html">AutoThrottle 扩展</a></li>
<li class="toctree-l1"><a class="reference internal" href="benchmarking.html">标杆管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="jobs.html">作业：暂停和恢复爬行</a></li>
<li class="toctree-l1"><a class="reference internal" href="coroutines.html">协同程序</a></li>
<li class="toctree-l1"><a class="reference internal" href="asyncio.html">asyncio</a></li>
</ul>
<p class="caption"><span class="caption-text">扩展Scrapy</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="architecture.html">体系结构概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="downloader-middleware.html">下载器中间件</a></li>
<li class="toctree-l1"><a class="reference internal" href="spider-middleware.html">蜘蛛中间件</a></li>
<li class="toctree-l1"><a class="reference internal" href="extensions.html">扩展</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">核心API</a></li>
<li class="toctree-l1"><a class="reference internal" href="signals.html">信号</a></li>
<li class="toctree-l1"><a class="reference internal" href="exporters.html">条目导出器</a></li>
</ul>
<p class="caption"><span class="caption-text">其余所有</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../news.html">发行说明</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">为 Scrapy 贡献</a></li>
<li class="toctree-l1"><a class="reference internal" href="../versioning.html">版本控制和API稳定性</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">Scrapy</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
        
      <li>发送电子邮件</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="module-scrapy.mail">
<span id="sending-e-mail"></span><span id="topics-email"></span><h1>发送电子邮件<a class="headerlink" href="#module-scrapy.mail" title="永久链接至标题">¶</a></h1>
<p>虽然python使通过 <a class="reference external" href="https://docs.python.org/3/library/smtplib.html#module-smtplib" title="(在 Python v3.9)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">smtplib</span></code></a> Slapy类库提供了自己的发送电子邮件的工具，非常容易使用，并且使用 <a class="reference external" href="https://twistedmatrix.com/documents/current/core/howto/defer-intro.html" title="(在 Twisted v20.3)"><span class="xref std std-doc">Twisted non-blocking IO</span></a> ，以避免干扰爬虫的非阻塞IO。它还提供了一个简单的用于发送附件的API，并且非常容易配置，其中有一些 <a class="reference internal" href="#topics-email-settings"><span class="std std-ref">settings</span></a> .</p>
<div class="section" id="quick-example">
<h2>快速实例<a class="headerlink" href="#quick-example" title="永久链接至标题">¶</a></h2>
<p>有两种方法可以实例化邮件发送者。您可以使用标准 <code class="docutils literal notranslate"><span class="pre">__init__</span></code> 方法：</p><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-1466963416408457"
     data-ad-slot="8850786025"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">scrapy.mail</span> <span class="kn">import</span> <span class="n">MailSender</span>
<span class="n">mailer</span> <span class="o">=</span> <span class="n">MailSender</span><span class="p">()</span>
</pre></div>
</div>
<p>或者您可以通过一个Scrapy设置对象来实例化它，该对象将尊重 <a class="reference internal" href="#topics-email-settings"><span class="std std-ref">settings</span></a> ：：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mailer</span> <span class="o">=</span> <span class="n">MailSender</span><span class="o">.</span><span class="n">from_settings</span><span class="p">(</span><span class="n">settings</span><span class="p">)</span>
</pre></div>
</div>
<p>下面是如何使用它发送电子邮件（不带附件）：：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mailer</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">to</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;someone@example.com&quot;</span><span class="p">],</span> <span class="n">subject</span><span class="o">=</span><span class="s2">&quot;Some subject&quot;</span><span class="p">,</span> <span class="n">body</span><span class="o">=</span><span class="s2">&quot;Some body&quot;</span><span class="p">,</span> <span class="n">cc</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;another@example.com&quot;</span><span class="p">])</span>
</pre></div>
</div>
</div>
<div class="section" id="mailsender-class-reference">
<h2>MailSender 类引用<a class="headerlink" href="#mailsender-class-reference" title="永久链接至标题">¶</a></h2>
<p>mailsender是从scrappy发送电子邮件的首选类，因为它使用 <a class="reference external" href="https://twistedmatrix.com/documents/current/core/howto/defer-intro.html" title="(在 Twisted v20.3)"><span class="xref std std-doc">Twisted non-blocking IO</span></a> 和框架的其他部分一样。</p>
<dl class="py class">
<dt id="scrapy.mail.MailSender">
<em class="property">class </em><code class="sig-prename descclassname">scrapy.mail.</code><code class="sig-name descname">MailSender</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">smtphost</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">mailfrom</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">smtpuser</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">smtppass</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">smtpport</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#scrapy.mail.MailSender" title="永久链接至目标">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>smtphost</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(在 Python v3.9)"><em>bytes</em></a>) -- 用于发送电子邮件的SMTP主机。如果省略， <a class="reference internal" href="#std-setting-MAIL_HOST"><code class="xref std std-setting docutils literal notranslate"><span class="pre">MAIL_HOST</span></code></a> 将使用设置。</p></li>
<li><p><strong>mailfrom</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a>) -- 用于发送电子邮件的地址（在 <code class="docutils literal notranslate"><span class="pre">From:</span></code> 标题）。如果省略， <a class="reference internal" href="#std-setting-MAIL_FROM"><code class="xref std std-setting docutils literal notranslate"><span class="pre">MAIL_FROM</span></code></a> 将使用设置。</p></li>
<li><p><strong>smtpuser</strong> -- SMTP用户。如果省略， <a class="reference internal" href="#std-setting-MAIL_USER"><code class="xref std std-setting docutils literal notranslate"><span class="pre">MAIL_USER</span></code></a> 将使用设置。如果未提供，则不会执行任何SMTP身份验证。</p></li>
<li><p><strong>smtppass</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(在 Python v3.9)"><em>bytes</em></a>) -- 用于身份验证的SMTP通行证。</p></li>
<li><p><strong>smtpport</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.9)"><em>int</em></a>) -- 要连接到的SMTP端口</p></li>
<li><p><strong>smtptls</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.9)"><em>bool</em></a>) -- 使用smtp starttls强制</p></li>
<li><p><strong>smtpssl</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.9)"><em>bool</em></a>) -- 强制使用安全的SSL连接</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="scrapy.mail.MailSender.from_settings">
<em class="property">classmethod </em><code class="sig-name descname">from_settings</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">settings</span></em><span class="sig-paren">)</span><a class="headerlink" href="#scrapy.mail.MailSender.from_settings" title="永久链接至目标">¶</a></dt>
<dd><p>使用Scrapy设置对象实例化，该对象将 <a class="reference internal" href="#topics-email-settings"><span class="std std-ref">these Scrapy settings</span></a> .</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>settings</strong> (<a class="reference internal" href="api.html#scrapy.settings.Settings" title="scrapy.settings.Settings"><code class="xref py py-class docutils literal notranslate"><span class="pre">scrapy.settings.Settings</span></code></a> object) -- 电子邮件收件人</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="scrapy.mail.MailSender.send">
<code class="sig-name descname">send</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">to</span></em>, <em class="sig-param"><span class="n">subject</span></em>, <em class="sig-param"><span class="n">body</span></em>, <em class="sig-param"><span class="n">cc</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">attachs</span><span class="o">=</span><span class="default_value">()</span></em>, <em class="sig-param"><span class="n">mimetype</span><span class="o">=</span><span class="default_value">'text/plain'</span></em>, <em class="sig-param"><span class="n">charset</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#scrapy.mail.MailSender.send" title="永久链接至目标">¶</a></dt>
<dd><p>向指定的收件人发送电子邮件。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>to</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(在 Python v3.9)"><em>list</em></a>) -- 以字符串或字符串列表的形式显示电子邮件收件人</p></li>
<li><p><strong>subject</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a>) -- 电子邮件的主题</p></li>
<li><p><strong>cc</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(在 Python v3.9)"><em>list</em></a>) -- 以字符串或字符串列表的形式向CC发送电子邮件</p></li>
<li><p><strong>body</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a>) -- 电子邮件主体</p></li>
<li><p><strong>attachs</strong> (<a class="reference external" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable" title="(在 Python v3.9)"><em>collections.abc.Iterable</em></a>) -- 不可数元组 <code class="docutils literal notranslate"><span class="pre">(attach_name,</span> <span class="pre">mimetype,</span> <span class="pre">file_object)</span></code> 在哪里？ <code class="docutils literal notranslate"><span class="pre">attach_name</span></code> 是一个字符串，其名称将显示在电子邮件附件中， <code class="docutils literal notranslate"><span class="pre">mimetype</span></code> 是附件的mimetype，并且 <code class="docutils literal notranslate"><span class="pre">file_object</span></code> 是具有附件内容的可读文件对象</p></li>
<li><p><strong>mimetype</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a>) -- 电子邮件的mime类型</p></li>
<li><p><strong>charset</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.9)"><em>str</em></a>) -- 用于电子邮件内容的字符编码</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="mail-settings">
<span id="topics-email-settings"></span><h2>邮件设置<a class="headerlink" href="#mail-settings" title="永久链接至标题">¶</a></h2>
<p>这些设置定义默认值 <code class="docutils literal notranslate"><span class="pre">__init__</span></code> 方法值 <a class="reference internal" href="#scrapy.mail.MailSender" title="scrapy.mail.MailSender"><code class="xref py py-class docutils literal notranslate"><span class="pre">MailSender</span></code></a> 类，并且可以用于在不编写任何代码的情况下在项目中配置电子邮件通知（对于使用 <a class="reference internal" href="#scrapy.mail.MailSender" title="scrapy.mail.MailSender"><code class="xref py py-class docutils literal notranslate"><span class="pre">MailSender</span></code></a> ）</p>
<div class="section" id="mail-from">
<span id="std-setting-MAIL_FROM"></span><span id="std:setting-MAIL_FROM"></span><h3>MAIL_FROM<a class="headerlink" href="#mail-from" title="永久链接至标题">¶</a></h3>
<p>违约： <code class="docutils literal notranslate"><span class="pre">'scrapy&#64;localhost'</span></code></p>
<p>要使用的发件人电子邮件 (<code class="docutils literal notranslate"><span class="pre">From:</span></code> 头）用于发送电子邮件。</p>
</div>
<div class="section" id="mail-host">
<span id="std-setting-MAIL_HOST"></span><span id="std:setting-MAIL_HOST"></span><h3>MAIL_HOST<a class="headerlink" href="#mail-host" title="永久链接至标题">¶</a></h3>
<p>违约： <code class="docutils literal notranslate"><span class="pre">'localhost'</span></code></p>
<p>用于发送电子邮件的SMTP主机。</p>
</div>
<div class="section" id="mail-port">
<span id="std-setting-MAIL_PORT"></span><span id="std:setting-MAIL_PORT"></span><h3>MAIL_PORT<a class="headerlink" href="#mail-port" title="永久链接至标题">¶</a></h3>
<p>违约： <code class="docutils literal notranslate"><span class="pre">25</span></code></p>
<p>用于发送电子邮件的SMTP端口。</p>
</div>
<div class="section" id="mail-user">
<span id="std-setting-MAIL_USER"></span><span id="std:setting-MAIL_USER"></span><h3>MAIL_USER<a class="headerlink" href="#mail-user" title="永久链接至标题">¶</a></h3>
<p>违约： <code class="docutils literal notranslate"><span class="pre">None</span></code></p>
<p>用于SMTP身份验证的用户。如果禁用，将不执行任何SMTP身份验证。</p>
</div>
<div class="section" id="mail-pass">
<span id="std-setting-MAIL_PASS"></span><span id="std:setting-MAIL_PASS"></span><h3>MAIL_PASS<a class="headerlink" href="#mail-pass" title="永久链接至标题">¶</a></h3>
<p>违约： <code class="docutils literal notranslate"><span class="pre">None</span></code></p>
<p>用于SMTP身份验证的密码，以及 <a class="reference internal" href="#std-setting-MAIL_USER"><code class="xref std std-setting docutils literal notranslate"><span class="pre">MAIL_USER</span></code></a> .</p>
</div>
<div class="section" id="mail-tls">
<span id="std-setting-MAIL_TLS"></span><span id="std:setting-MAIL_TLS"></span><h3>MAIL_TLS<a class="headerlink" href="#mail-tls" title="永久链接至标题">¶</a></h3>
<p>违约： <code class="docutils literal notranslate"><span class="pre">False</span></code></p>
<p>使用starttls强制。starttls是一种获取现有不安全连接并使用ssl/tls将其升级为安全连接的方法。</p>
</div>
<div class="section" id="mail-ssl">
<span id="std-setting-MAIL_SSL"></span><span id="std:setting-MAIL_SSL"></span><h3>MAIL_SSL<a class="headerlink" href="#mail-ssl" title="永久链接至标题">¶</a></h3>
<p>违约： <code class="docutils literal notranslate"><span class="pre">False</span></code></p>
<p>使用SSL加密连接强制连接</p>
</div>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="telnetconsole.html" class="btn btn-neutral float-right" title="远程登录控制台" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="stats.html" class="btn btn-neutral float-left" title="统计数据集合" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        
        &copy; 版权所有 2008–2020, Scrapy developers
      <span class="lastupdated">
        最后更新于 10月 18, 2020.
      </span>

    </p>
  </div>
    
    
    
    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
  
 
<script type="text/javascript">
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.1.0";
analytics.load("8UDQfnf3cyFSTsM4YANnW5sXmgZVILbA");
analytics.page();
}}();

analytics.ready(function () {
    ga('require', 'linker');
    ga('linker:autoLink', ['scrapinghub.com', 'crawlera.com']);
});
</script>


</body>
</html>